﻿<!--#include file="../../../../../popasp/lasp.asp" -->
<%
	on error resume next
	Dim POP_MVC,tpl,pasp
	set POP_MVC = new POPASP_MVC
	set pasp = POP_MVC
	POP_MVC.mvc_dir = "../../popasp/"
	call POP_MVC.init
	POP_MVC.dG_("startTime") = 56942.8
	POP_MVC.dG_("beginTime") = beginTime__
	
	call G_("initTime")
	
	set tpl = D_
	IF Not isEmpty ( session( "./home/Index/listSheet_where" ) ) Then 
		If session("./home/Index/listSheet_where") = 1 Then 
			set tpl= js_decode(session("./home/Index/listSheet"))
		Else 
			set tpl = js_decode( POP_MVC.file_get_contents(session("./home/Index/listSheet")) )
		End If 
	End If
	call G_("loadTime")
	
	Function getMemory( key )
		getMemory = Application.Contents( "D:\asp\easyasp\test2\xls__" & key )
	End Function
%>
<h1><% Response.Write "Index/listSheet.html" %>模板</h1>
<hr />
<a href="/xls/index.asp?c=Assign&a=listBooks">显示所有工作簿</a>
|
<a href="/xls/index.asp?c=Index&a=listBooks">显示“<% Response.Write session("assignedBook") %>”工作簿的所有工作表</a>
<hr />
<%  dim key,k,prikey,begin %>
<%  prikey = tpl("prikey") %> 
<table border="1" cellspacing="1">
<tr>
<% 
tpl("_total") = 0
If isArray(tpl("fields")) Then 
tpl("_total") = UBound(tpl("fields")) + 1
Else
Select Case typename( tpl("fields") )
  Case "Dictionary","Files","IVariantDictionary","IRequestDictionary" : tpl("_total") = tpl("fields").Count
  Case "Recordset" : tpl("_total") = tpl("fields").RecordCount
  Case "ISessionObject" : tpl("_total") = tpl("fields").Contents.Count
End Select
End If
tpl("_rownum") = 0
If tpl("_total") >0 Then
For Each k In tpl("fields") : If isObject( tpl("fields")(k) ) Then Set tpl("value") = tpl("fields")(k) Else tpl("value") = tpl("fields")(k)
If tpl("_rownum") = 0 Then tpl("_first") = True Else tpl("_first") = False
tpl("_rownum") = tpl("_rownum") + 1
tpl("_index") = tpl("_rownum") - 1
If tpl("_total") <> 0 AND tpl("_total") = tpl("_rownum") Then tpl("_last") = True Else tpl("_last") = False 
If tpl("_total") < tpl("_rownum") Then tpl("_total") = tpl("_rownum")
%>
<th><%  If tpl.Exists("value") Then Response.Write tpl("value") End If %></th>
<%  Next 
End If  %>
<% If tpl("prikey")<>"" Then %>
<th>修改</th>
<%  End If  %>
</tr>
<% 
tpl("_total") = 0
If isArray(tpl("list")) Then 
tpl("_total") = UBound(tpl("list")) + 1
Else
Select Case typename( tpl("list") )
  Case "Dictionary","Files","IVariantDictionary","IRequestDictionary" : tpl("_total") = tpl("list").Count
  Case "Recordset" : tpl("_total") = tpl("list").RecordCount
  Case "ISessionObject" : tpl("_total") = tpl("list").Contents.Count
End Select
End If
tpl("_rownum") = 0
If tpl("_total") >0 Then
For Each key In tpl("list") : If isObject( tpl("list")(key) ) Then Set tpl("item") = tpl("list")(key) Else tpl("item") = tpl("list")(key)
If tpl("_rownum") = 0 Then tpl("_first") = True Else tpl("_first") = False
tpl("_rownum") = tpl("_rownum") + 1
tpl("_index") = tpl("_rownum") - 1
If tpl("_total") <> 0 AND tpl("_total") = tpl("_rownum") Then tpl("_last") = True Else tpl("_last") = False 
If tpl("_total") < tpl("_rownum") Then tpl("_total") = tpl("_rownum")
%>
	<tr>
		<% 
tpl("_total") = 0
If isArray(tpl("fields")) Then 
tpl("_total") = UBound(tpl("fields")) + 1
Else
Select Case typename( tpl("fields") )
  Case "Dictionary","Files","IVariantDictionary","IRequestDictionary" : tpl("_total") = tpl("fields").Count
  Case "Recordset" : tpl("_total") = tpl("fields").RecordCount
  Case "ISessionObject" : tpl("_total") = tpl("fields").Contents.Count
End Select
End If
tpl("_rownum") = 0
If tpl("_total") >0 Then
For Each k In tpl("fields") : If isObject( tpl("fields")(k) ) Then Set tpl("value") = tpl("fields")(k) Else tpl("value") = tpl("fields")(k)
If tpl("_rownum") = 0 Then tpl("_first") = True Else tpl("_first") = False
tpl("_rownum") = tpl("_rownum") + 1
tpl("_index") = tpl("_rownum") - 1
If tpl("_total") <> 0 AND tpl("_total") = tpl("_rownum") Then tpl("_last") = True Else tpl("_last") = False 
If tpl("_total") < tpl("_rownum") Then tpl("_total") = tpl("_rownum")
%>
		<td><% Response.write tpl("item")(tpl("value")) %></td>
		<%  Next 
End If  %>
		<% If tpl("prikey")<>"" Then %>
		<td width="200px" align="center">
		<a href="/xls/index.asp?c=Index&a=listRecord&id=<% Response.Write tpl("item")(prikey) %>">查看</a>
		|
		<a href="/xls/index.asp?c=Index&a=editRecord&id=<% Response.Write tpl("item")(prikey) %>">修改</a>
		|
		<a href="/xls/index.asp?c=Index&a=deleteRecord&id=<% Response.Write tpl("item")(prikey) %>">删除</a></td>
		<%  End If  %>
	</tr>
<%  Next 
End If  %>
</table>
<p>
<a href="/xls/index.asp?c=Index&a=addRecord">添加</a>
<% If tpl("page")<>"" Then %>
|
<%  If tpl.Exists("page") Then Response.Write tpl("page") End If %>
<%  End If  %>
</p>
<!--#include file="../../../../../popasp/tpl/poplite_end.inc.txt" -->